import 'package:flutter/material.dart';

class navigationButton extends StatelessWidget {
  navigationButton(
      {required this.childWidget,
      required this.backColor,
      this.buttonFlex = 1,
      required this.buttonPressed});

  final Widget childWidget;
  final MaterialStateProperty<Color> backColor;
  final int buttonFlex;
  final void Function()? buttonPressed;

  @override
  Widget build(BuildContext context) {
    return Expanded(
      flex: buttonFlex,
      child: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 4.0, vertical: 6.0),
        child: TextButton(
          onPressed: buttonPressed,
          style: ButtonStyle(
            backgroundColor: backColor,
            shape: MaterialStateProperty.all(
              RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(25),
              ),
            ),
          ),
          child: childWidget,
        ),
      ),
    );
  }
}
